import request from '@/utils/request'

const api_name = "/admin/hosp/hospitalSet"

export default {
    // 查询列表 By 分页+条件
    getPageList(current, size, searchObj) {
        return request({
            url: `${api_name}/${current}/${size}`,
            method: 'post',
            // 使用 json 格式传递数据
            data: searchObj
        })
    },
    // 删除 By ID
    removeById(id) {
        return request({
            url: `${api_name}/${id}/`,
            method: 'delete'
        })
    },

    // 新增
    save(hospset) {
        return request({
            url: `${api_name}/saveHospSet/`,
            method: 'post',
            data: hospset
        })
    },
    // 查询 By Id
    getById(id) {
        return request({
            url: `${api_name}/getHospSet/${id}`,
            method: 'get'
        })
    },
    // 修改 By Id
    updateById(hospset) {
        return request({
            url: `${api_name}/updateHospSet`,
            method: 'put',
            data: hospset
        })
    },

    // 锁定和解锁
    lockHospSet(id, status) {
        return request({
            url: `${api_name}/lockHospitalSet/${id}/${status}`,
            method: 'put'
        })
    },
    // 批量删除
    removeRows(idList){
        return request({
            url: `${api_name}/batchRemove`,
            method: 'delete',
            data: idList
        })
    }

}